<?php
class Default_Form_Field extends Zend_Form
{
    public function init()
    {
        $this->setName("field");
        $fieldId = new Zend_Form_Element_Hidden('fieldId');
        $fieldId->addFilter('Int');
        
        $fieldName = new Zend_Form_Element_Text('fieldName');
        $fieldName->setLabel('Tên thuộc tính')->setRequired(true)->addFilter('StripTags')->addFilter('StringTrim')->addValidator('NotEmpty');
        $fieldName->setAttrib('size', 60);
       
        $type = new Zend_Form_Element_Select('type');
        $type->setLabel('Kiểu')->addFilter('StripTags')->addFilter('StringTrim');
        $type->addMultiOption('text','text');
        $type->setAttrib('style', 'width: 200px');
      
        // submit button
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id','submitbutton');
        $submit->setAttrib('class',"button medium");
        // add elements to form
        $hash = new Zend_Form_Element_Hash('no_csrf_foo');
        $this->addElement('hash','no_csrf_foo',array (
            'salt' => 'T1EJtbLm40sRWNsj'
        ));
        $this->addElements(array(
            $fieldId ,$fieldName ,$type ,$submit
        ));
    }
}

